package cn.xawl.gulimall.cart.vo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author lh
 * @create 2020-11-02 12:43
 *
 * 用户购物车中每一项的信息
 *
 **/
public class CartItem {

    private Long skuId; //

    private Boolean checked = false; //是否默认被选中

    private String title; //商品标题

    private String image; //商品图片

    private List<String> saleAttr; //销售属性

    private BigDecimal unitPrice; //单价

    private Integer count;

    private BigDecimal subTotal; //小计：数量 * 单价

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Boolean getChecked() {
        return checked;
    }

    public void setChecked(Boolean checked) {
        this.checked = checked;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<String> getSaleAttr() {
        return saleAttr;
    }

    public void setSaleAttr(List<String> saleAttr) {
        this.saleAttr = saleAttr;
    }

    public BigDecimal getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(BigDecimal unitPrice) {
        this.unitPrice = unitPrice;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public BigDecimal getSubTotal() {

        return unitPrice.multiply(new BigDecimal(count));
    }

}
